package cn.itsource.org.service;

import cn.itsource.basic.util.PageList;
import cn.itsource.org.domain.Department;
import cn.itsource.org.query.DepartmentQuery;
import com.github.pagehelper.PageInfo;

import java.util.List;

public interface IDepartmentService {
    //查询所有的部门数据
    List<Department> findAll();

    //根据id查询一个部门对象
    Department findOne(Long id);

    //新增/修改一个部门对象
    //新增没有主键id值  修改必须有主键id值
    void saveOrUpdate(Department department);

    //根据主键id删除一个部门对象
    void delete(Long id);

    //批量删除
    void batchDelete(Long[] ids);

    //分页查询
    PageList<Department> findPage(DepartmentQuery query);

    //查询上级部门
    List<Department> findParentDepts();

    List<Department> treeList();
}
